<?php
namespace app\common\model;
use think\Model;

/**
 * Description of Zjslog
 *
 * @author HuangLuSen
 */
class Zjslog extends Model {

    public function getOperationTextAttr($value,$data)
    {
        $status = [1=>'系统建单',2=>'审核通过',3=>'审核拒绝',4=>'自动修改状态',5=>'修改资料',6=>'给介绍人发微信'];
        return $status[$data['operation']];
    }

//    public function getCzryTextAttr($value,$data)
//    {
//        $status = Leibie::kefu();
//        return $status[$data['czry']];
//    }

    public function getStateTextAttr($value,$data)
    {
        $status = [1=>'<span style="color: green;">成功</span>',2=>'<span style="color: red;">失败</span>'];
        return $status[$data['state']];
    }

    /**
     * 操作人员的名称
     * @return \think\model\relation\BelongsTo
     */
    public function user(){
        return $this->belongsTo('users','czry','id','left')->field('username');
    }
    public function zjsuser(){
        return $this->belongsTo('customer','czry','id','left')->field('username');
    }


    
}
